<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>Swiper demo</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
  <!-- Link Swiper's CSS -->
  <link rel="stylesheet" href="/web_static/sale/swiper.min.css">
  <!-- Demo styles -->
  <style>
    html, body {
      position: relative;
      height: 300px;
    }
    body {
      max-width: 640px;
      min-width: 320px;
      background: #eee;
      font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
      font-size: 14px;
      color:#000;
    }
    body,ul,li,p,h1,h2,h3,h4,h5{
      margin: 0;
      padding: 0;
    }
    .swiper-container {
      width: 100%;
      height: 100%;
    }
    .swiper-slide {
      text-align: center;
      font-size: 18px;
      background: #fff;

      /* Center slide text vertically */
      display: -webkit-box;
      display: -ms-flexbox;
      display: -webkit-flex;
      display: flex;
      -webkit-box-pack: center;
      -ms-flex-pack: center;
      -webkit-justify-content: center;
      justify-content: center;
      -webkit-box-align: center;
      -ms-flex-align: center;
      -webkit-align-items: center;
      align-items: center;
    }
    .swiper-slide div{
      width: 100%;
      height: 400px;
      background-size: 100% 100%;
      background-repeat: no-repeat;
    }
    .sale_des{
      margin-top: 20px;
    }
    .sale_des dt{
      background: #EEE9E6;
      color: #6C594D;
      font-size: 16px;
      line-height: 30px;

      margin: 0;
      width: 100%;
      clear: both;
      text-align: left;
    }
    .sale_des dt:before{
      content: "▼";
      color: #948157;
      padding: 0 10px;
    }
    .sale_des div{
      width: 96%;
      margin: 0 auto;
      margin-top: 8px;
    }
    .product_buy{
      padding: 10px;
    }
    .product{
      border-radius: 5px;
      box-shadow: 0 1px 2px 2px #E4E4E4;
      overflow: hidden;
      padding: 10px;
      background: #fafafa;
    }
    .product img{
      float: left;
      margin: 0 10px 10px 0;
    }
    .pro_title {
      margin-top: 5px;
      font-size: 15px;
      font-weight: 700;
    }
    .pro_des{
      color: #999;
    }
    .pro_type{
      clear: left;
    }
    .pro_type li{
      display: inline-block;
      _zoom: 1;
      margin: 0 6px 6px 0;
    }
    .pro_type li a{
      line-height: 30px;
      border: 1px solid #ceced0;
      background-color: #fafafa;
      border-radius: 5px;
      padding: 0 15px;
      display: inline-block;
    }
    .product_bot p{
      width: 90%;
      height:34px;
      line-height: 34px;
      margin-top: 8px;
      margin-left: 5%;
    }
    .product_bot p label{
      width: 80px;
      display: block;
      float: left;
    }
    .product_bot p input{
      width: 200px;
      height: 28px;
      border-radius: 4px;
      border: 1px solid #ccc;
      padding-left: 5px;
    }
    .product_bot p textarea{
      width: 300px;
      height: 40px;
      margin-top: 7px;
      border-radius: 4px;
      border: 1px solid #ccc;
      padding-left: 5px;
    }
    .product_bot p select{
      width: 100px;
      height: 28px;
      border-radius: 4px;
      border: 1px solid #ccc;
    }
    .product_bot{
      margin-top: 8px;
      height: 390px;
    }
    .fixed_yz{
      position: fixed;
      top: 30%;
      left: 0;
      right: 0;
      margin: 0 auto;
      height: 200px;
      width: 86%;
      background-color: #f1efef;
      z-index: 9999;
      overflow: hidden;
      border: 1px solid #ccc;
      border-radius: 4px;
      box-shadow: 3px 3px 3px #888;
      display: none;
    }
    .fixed_yz_div{
      margin-top: 20px;
    }
    .fixed_yz_div p{
      margin-top: 10px;
      text-align: center;
    }
    .fixed_yz_div .img{
      float:none;
      margin:0;
      cursor: pointer;
      height: 18px;
      vertical-align: middle;
      margin-left: 10px;
    }
    .fixed_yz_div input{
      height: 20px;
      line-height: 20px;
      padding-left: 2px;
      line-height: 20px;
    }
    .fixed_yz_div button{
      height: 24px;
      line-height: 24px;
      padding-left: 2px;
      margin:0;
      cursor: pointer;
      margin-left: 10px;
      width: 88px;
      border-radius: 4px;
      border: 1px;
    }
    .yc{
      position: fixed;
      left:0;
      right:0;
      top:0;
      bottom:0;
      background-color: #ccc;
      z-index: 8888;
      opacity: 0.4;
      display: none;
    }
  </style>
</head>
<body style="margin: 0 auto;">
<!-- Swiper -->
<div class="swiper-container">
  <div class="swiper-wrapper">
    <div class="swiper-slide"><div style="background-image: url('/uploads/advert_img/5abc657a061a8.jpg')"></div></div>
    <div class="swiper-slide"><div style="background-image: url('/uploads/advert_img/5abc65888e940.jpg')"></div></div>
    <div class="swiper-slide"><div style="background-image: url('/uploads/advert_img/5abc6597251c0.jpg')"></div></div>
    <div class="swiper-slide"><div style="background-image: url('/uploads/advert_img/5abc657a061a8.jpg')"></div></div>
  </div>
  <!-- Add Pagination -->
  <div class="swiper-pagination"></div>
</div>
<div class="sale_des">
  <dt>产品描述</dt>
  <div>
    【产品名称】：吕家传冷敷贴<br/>

    【产品规格】：1盒10贴<br/>

    【使用方法】：将本产品直接贴于病灶处皮肤表面即可，每帖贴敷时间6-8小时。<br/>
  </div>
</div>
<div class="product_buy">
  <div class="product">
    <img src="http://www.durun.net/wftemplate/cpimg/23139.jpg" height="80" width="80" onerror="this.src='cpimg/nopic.jpg'">
    <p class="pro_title">吕家传</p>
    <p class="pro_des">货到付款并包邮</p>
    <ul class="pro_type">
      <li><a href="javascript:void(0);" class="" data-price="150" data-sku="一盒体验装 150元">一盒体验装 150元</a></li>
      <li><a href="javascript:void(0);" class="" data-price="388" data-sku="三盒疗程装 388元">三盒疗程装 388元</a></li>
      <li><a href="javascript:void(0);" class="sku_cur" data-price="888" data-sku="八盒巩固装 888元">八盒巩固装 888元</a></li>
    </ul>
  </div>
  <div class="product product_bot">
    <p>
      <label>收货人:</label>
      <input class="name" value="" type="text">
    </p>
    <p>
      <label>手机号:</label>
      <input class="input phone" value="" type="text">
    </p>
    <p>
      <label>选择地区:</label>
      <select class="province"><option>省份</option></select>
      <select class="city"><option>城市</option></select>
    </p>
    <p>
      <label>详细地址:</label>
      <input class="address" value="" type="text">
    </p>
    <p>
      <label>备注:</label>
      <input class="comment" value="" type="text">
    </p>
    <p style="margin-top: 50px; text-align: center;">
      <input class="input" value="提交" type="button" style="margin: 0 auto;" onclick="submit()">
    </p>
  </div>
</div>
<div class="sale_des">
  <dt>使用方法</dt>
  <div>
    1，清洁皮肤<br/>

    贴 吕家传医用冷敷贴，将皮肤清洁一下，如果能在贴膏药处先擦点生姜，可加速血液循环，使药性更好地发挥。特别是在冬天，容易因天气寒冷而贴不紧。将膏药隔水加热一下再贴，就不会翘边，可保药物不浪费。<br/>

    2，方法要正确<br/>

    在贴膏药之前，应先用热毛巾将患处或穴位处的皮肤擦净拭干，然后再贴。冬天气候寒冷时，橡皮类膏药往往不易粘贴住，这时可将膏药贴好后再用热水袋敷一下，以便粘贴牢固，增加效果。烘烤方法也有讲究，应先将膏药放在酒精灯、蜡烛等微火上加温或将其漂浮在开水上面软化，等烘烤后的膏药不烫皮肤时再贴于患处。<br/>

    3，部位要选准<br/>

    先摸准疼痛点。粘贴时，先将膏药与衬垫分开一部分，贴准痛处附近，顺着痛点方向边粘边将衬垫撕去，可以准确地将膏药中央置于痛点，并可使膏药粘贴平整无褶。贴敷位置不准会影响疗效。<br/>
  </div>
</div>
<div class="yc"></div>
<div class="fixed_yz">
   <i style="position: absolute;right: 6px;top: 3px;height: 20px;width: 20px;text-align: center;line-height: 20px;" onclick="yc()">X</i>
  <div class="fixed_yz_div">
    <p><label>验证手机:</label><input class="input phone_dis" value="" type="text" disabled></p>
    <p>
      <input class="input" style="width: 120px;" placeholder="请输入图片验证码" type="text">
      <img src="/pc_code?code=sale" alt="" title="点击更换验证码" onclick="this.src='/pc_code?code=sale&t='+Math.random();"><span style="font-size: 10px;color: red;"></span></p>
    <p><label></label>
      <input class="input" style="width: 100px;" value="" placeholder="手机验证码" type="text">
      <button style="">获取验证码</button></p>
    <p><button style="margin-top: 20px;">确认下单</button></p>
  </div>

</div>
<script type="text/javascript" src="/web_static/www/js/jquery.js"></script>
<script>
  $('.phone').bind('input', function()
  {
    //获取.input-form下的所有 <input> 元素,并实时监听用户输入
    $('.phone_dis').val($(this).val());
  })
  function yc(){
    $('.fixed_yz').hide();
    $('.yc').hide();
  }
  function submit(){
    var name = $('.name').val();
    var phone = $('.phone').val();
    var province = $(".province").val();
    var city = $(".city").val();
    var address = $('.address').val();
    var comment = $('.comment').val();
    if(!name){
      alert('请填写收获人姓名!');return;
    }
    if(!phone.match(/^1[34578]\d{9}$/)) {
      alert('手机号码不正确!');return;
    }
    console.log(city);
    if(!province||province==0){
      alert('请输入省份!');return;
    }
    if(!city||city==0){
      alert('请输入城市!');return;
    }
    if(!address){
      alert('请输入收件地址!');return;
    }
    $('.fixed_yz').show();
    $('.yc').show();
  }
  $(".province").on("change",function(){
    var pid = $(this).val();
    $.ajax({
      type:'get',
      dataType:'json',
      data:'province_id='+pid,
      url: "/city",
      success:function(json){
        console.log(json);
        var data = json.data;
        var htmls = ''
        htmls += '<option value="0">城市</option>';
        for (var i=0;i<data.length;i++)
        {
          htmls +='<option value="'+data[i].id+'">'+data[i].city+'</option>';
        }
        $('.city').html(htmls);
      }
    })
  })
  $.ajax({
    type:'get',
    dataType:'json',
    data:'',
    url: "/city",
    success:function(json){
      console.log(json);
      var data = json.data;
      var htmls = ''
      htmls += '<option value="0">省份</option>';
      for (var i=0;i<data.length;i++)
      {
        htmls +='<option value="'+data[i].id+'">'+data[i].name+'</option>';
      }
      $('.province').html(htmls);
    }
  })
  //检测注册只能输入数字
  $(".phone").keyup(function () {
    this.value = this.value.replace(/[^\d]/g, '').replace(/(\d{4})(?=\d)/g, "$1");
  });
</script>
<!-- Swiper JS -->
<script src="/web_static/sale/swiper.min.js"></script>

<!-- Initialize Swiper -->
<script>
  var swiper = new Swiper('.swiper-container', {
    pagination: {
      el: '.swiper-pagination',
    },
  });
</script>
</body>
</html>